﻿using System.Reflection;
using StudentManagementSystem.Dtos;
using StudentManagementSystem.Entities;

namespace StudentManagementSystem.Services
{
    public interface ICompanyRepository
    {
        /// <summary>
        /// 获取所有公司列表
        /// </summary>
        /// <returns>公司集合</returns>
        Task<IEnumerable<Company>> GetCompaniesAsync(CompanyDtoParameters parameter);

        /// <summary>
        /// 根据ID获取单个公司
        /// </summary>
        /// <param name="companyId">公司ID</param>
        /// <returns>公司实体</returns>
        Task<Company> GetCompanyAsync(Guid companyId);

        /// <summary>
        /// 根据ID列表获取公司集合
        /// </summary>
        /// <param name="companyIds">公司ID列表</param>
        /// <returns>公司集合</returns>
        Task<IEnumerable<Company>> GetCompaniesAsync(IEnumerable<Guid> companyIds);

        /// <summary>
        /// 添加新公司
        /// </summary>
        /// <param name="company">公司实体</param>
        void AddCompany(Company company);

        /// <summary>
        /// 更新公司信息
        /// </summary>
        /// <param name="company">已修改的公司实体</param>
        void UpdateCompany(Company company);

        /// <summary>
        /// 删除公司
        /// </summary>
        /// <param name="company">要删除的公司实体</param>
        void DeleteCompany(Company company);

        /// <summary>
        /// 检查公司是否存在
        /// </summary>
        /// <param name="companyId">公司ID</param>
        /// <returns>存在返回true，否则false</returns>
        Task<bool> CompanyExistsAsync(Guid companyId);

        /// <summary>
        /// 根据公司ID获取员工列表
        /// </summary>
        /// <param name="companyId">公司ID</param>
        /// <returns>员工集合</returns>
        Task<IEnumerable<Employee>> GetEmployeesAsync(Guid companyId, string genderDisplay, string q);

        /// <summary>
        /// 根据公司ID和员工ID获取单个员工
        /// </summary>
        /// <param name="companyId">公司ID</param>
        /// <param name="employeeId">员工ID</param>
        /// <returns>员工实体</returns>
        Task<Employee> GetEmployeeAsync(Guid companyId, Guid employeeId);

        /// <summary>
        /// 添加新员工到指定公司
        /// </summary>
        /// <param name="companyId">目标公司ID</param>
        /// <param name="employee">新员工实体</param>
        void AddEmployee(Guid companyId, Employee employee);

        /// <summary>
        /// 更新员工信息
        /// </summary>
        /// <param name="employee">已修改的员工实体</param>
        void UpdateEmployee(Employee employee);

        /// <summary>
        /// 删除员工
        /// </summary>
        /// <param name="employee">要删除的员工实体</param>
        void DeleteEmployee(Employee employee);

        Task<bool> SaveAsync();
    }
}
